package com.foreknow.demo4;

import java.util.Scanner;

public class MethodDemo {
    public void m1(Student s) {
        System.out.println(s.sid + "--" + s.name);
    }

    public Student m2(Student a) {
        return a;
    }

    public void m3(Scanner input) {
        System.out.println("请输入用户名：");
        System.out.println(input.next());
    }

    public Scanner m4() {
        Scanner kk = new Scanner(System.in);
        return kk;
    }
    public static void main(String[] args) {
        MethodDemo demo = new MethodDemo();
        Student s1 = new Student();
        s1.sid = 1001;
        s1.name = "fender";
        demo.m1(s1);

        Student s = demo.m2(s1);
        s.showInfo();

        Scanner in = new Scanner(System.in);
        demo.m3(in);

        Scanner ss = demo.m4();
        System.out.println(ss.next());
    }

}
